package com.szyportal.custom.service.impl;

import java.util.List;
import com.szyportal.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.szyportal.custom.mapper.WNoticeMapper;
import com.szyportal.custom.domain.WNotice;
import com.szyportal.custom.service.IWNoticeService;
import com.szyportal.common.core.text.Convert;

/**
 * 广播Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-03
 */
@Service
public class WNoticeServiceImpl implements IWNoticeService 
{
    @Autowired
    private WNoticeMapper wNoticeMapper;

    /**
     * 查询广播
     * 
     * @param id 广播主键
     * @return 广播
     */
    @Override
    public WNotice selectWNoticeById(Long id)
    {
        return wNoticeMapper.selectWNoticeById(id);
    }

    /**
     * 查询广播列表
     * 
     * @param wNotice 广播
     * @return 广播
     */
    @Override
    public List<WNotice> selectWNoticeList(WNotice wNotice)
    {
        return wNoticeMapper.selectWNoticeList(wNotice);
    }

    /**
     * 新增广播
     * 
     * @param wNotice 广播
     * @return 结果
     */
    @Override
    public int insertWNotice(WNotice wNotice)
    {
        wNotice.setCreateTime(DateUtils.getNowDate());
        return wNoticeMapper.insertWNotice(wNotice);
    }

    /**
     * 修改广播
     * 
     * @param wNotice 广播
     * @return 结果
     */
    @Override
    public int updateWNotice(WNotice wNotice)
    {
        wNotice.setUpdateTime(DateUtils.getNowDate());
        return wNoticeMapper.updateWNotice(wNotice);
    }

    /**
     * 批量删除广播
     * 
     * @param ids 需要删除的广播主键
     * @return 结果
     */
    @Override
    public int deleteWNoticeByIds(String ids)
    {
        return wNoticeMapper.deleteWNoticeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除广播信息
     * 
     * @param id 广播主键
     * @return 结果
     */
    @Override
    public int deleteWNoticeById(Long id)
    {
        return wNoticeMapper.deleteWNoticeById(id);
    }
}
